#include<bits/stdc++.h>
using namespace std;
int TT=200;
char s[1000005];
int n;
char ans[205][205];
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
char outt[4]={'R','L','D','U'};
int now[4];
int flag=0;
int minn,minm,maxn,maxm;
stack<char>ss;
void dfs(int x,int y,int len)
{
    minn=min(minn,x);
    maxn=max(maxn,x);
    minm=min(minm,y);
    maxm=max(maxm,y);
    if(len==n+1)
    {
        flag=1;
        return;
    }
    if(abs(x-TT/2)<=abs(y-TT/2))
    {
        if(y<TT/2)
        {
            now[0]=0;
            now[3]=1;
        }
        else
        {
            now[0]=1;
            now[3]=0;
        }
        if(x<TT/2)
        {
            now[1]=2;
            now[2]=3;
        }
        else
        {
            now[1]=3;
            now[2]=2;
        }
    }
    else
    {
        if(y<TT/2)
        {
            now[1]=0;
            now[2]=1;
        }
        else
        {
            now[1]=1;
            now[2]=0;
        }
        if(x<TT/2)
        {
            now[0]=2;
            now[3]=3;
        }
        else
        {
            now[0]=3;
            now[3]=2;
        }
    }
    for(int i=0;i<4;i++)
    {
        //cout<<x<<" "<<y<<" "<<now[i]<<endl;
        int xx=x+dx[now[i]],xy=y+dy[now[i]];
        if(xx<=0||xx>TT||xy<=0||xy>TT)
        {
            continue;
        }
        if(ans[xx][xy]==s[len])
        {
            //cout<<outt[now[i]];
            ss.push(outt[now[i]]);
            dfs(xx,xy,len+1);
            return;
        }
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    freopen("snake.in","r",stdin);
    freopen("snake.out","w",stdout);
    /*if(n<1000000)
    {
        TT=100;
    }*/
    cin>>(s+1);
    n=strlen(s+1);
    int sx=TT/2,sy=TT/2;
    //cout<<TT<<" "<<TT<<endl;
    ans[0][0]='G';
    ans[0][1]='G';
    ans[0][2]='R';
    ans[1][0]='B';
    ans[1][1]='B';
    ans[1][2]='R';
    ans[2][0]='R';
    ans[2][1]='G';
    ans[2][2]='G';
    ans[3][0]='R';
    ans[3][1]='B';
    ans[3][2]='B';
    for(int i=1;i<=TT;i++)
    {
        for(int j=1;j<=TT;j++)
        {
            ans[i][j]=ans[i%4][j%3];
            //cout<<ans[i][j];
        }
        //cout<<endl;
    }
    for(int i=0;i<4;i++)
    {
        if(ans[sx+dx[i]][sy+dy[i]]==s[1])
        {
            sx+=dx[i];
            sy+=dy[i];
            break;
        }
    }
    //cout<<sx<<" "<<sy<<endl
    minn=0x3f3f3f3f;
    maxn=-0x3f3f3f3f;
    minm=0x3f3f3f3f;
    maxm=-0x3f3f3f3f;
    dfs(sx,sy,2);
    cout<<maxn-minn+1<<" "<<maxm-minm+1<<endl;
    for(int i=minn;i<=maxn;i++)
    {
        for(int j=minm;j<=maxm;j++)
        {
            cout<<ans[i][j];
        }
        cout<<endl;
    }
    cout<<sx-minn+1<<" "<<sy-minm+1<<endl;
    while(!ss.empty())
    {
        cout<<ss.top();
        ss.pop();
    }
    return 0;
}
